package com.cxhc.cockpit;

import com.cxhc.common.annotation.Anonymous;
import com.cxhc.common.core.domain.R;
import com.cxhc.system.domain.cockpit.CmInfo;
import com.cxhc.system.service.cockpit.ICmInfoService;
import lombok.SneakyThrows;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;


/**
 * 公告
 */
@RestController()
@RequestMapping("/cockpit/cmInfo")
@CrossOrigin(origins = "*", maxAge = 3600)
public class ApiCmInfo {

    @Resource
    private ICmInfoService cmInfoService;

    /**
     * 统计用户数量
     */
    @Anonymous
    @SneakyThrows
    @RequestMapping("/queryCmInfo")
    public R<List<CmInfo>> queryUserCount() {
        return R.ok(cmInfoService.queryCmInfo());
    }
}
